<?php $limits = array(1, 5, 10, 15, 20, 25, 30, 50, 100);?>
<div class="pagination">
	<div class="limit">Display #
		<select name="limit" id="limit"
			class="inputbox" size="1" onchange="this.form.submit();">
			<?php foreach ($limits as $limit) :?>
				<?php if ($limit == $this->itemCountPerPage) :?>
					<?php $selected = 'selected = "true"'?>
				<?php else :?>
					<?php $selected = ''?>
				<?php endif?>
    			<option value="<?php echo $limit?>" <?php echo $selected?>><?php echo $limit?></option>
			<?php endforeach?>
		</select>
	</div>
    <?php if ($this->pageCount > 1): ?>
        <?php if (isset($this->previous)): ?>
    		<!-- First link -->
    		<div class="button2-right">
    			<div class="start"><a href="<?php echo $this->url(array('page' => 1))?>" title="Start">Start</a></div>
    		</div>
            <!-- Previous page link -->
          	<div class="button2-right">
				<div class="prev"><a href="<?php echo $this->url(array_merge($_GET, array('page' => $this->previous))); ?>" title="Prev">Prev</a></div>
			</div>
            <?php else: ?>
    		<div class="button2-right">
    			<div class="start"><span>Start</span></div>
    		</div>
            <div class="button2-right off">
				<div class="prev"><span>Prev</span></div>
			</div>
        <?php endif; ?>
        
        <!-- Pages link -->
        <div class='button2-left'>
            <div class='page'>
                <?php foreach ($this->pagesInRange as $page): ?>
                  <?php if ($page != $this->current): ?>
                    	<a href="<?php echo $this->url(array_merge($_GET, array('page' => $page))); ?>" title="<?php echo $page?>"><?php echo $page?></a>
                  <?php else: ?>
                        <span><?php echo $page; ?></span>
                  <?php endif; ?>
                <?php endforeach; ?>
            </div>
        </div>
		
        <!-- Next page link -->
        <?php if (isset($this->next)): ?>
          	<div class="button2-left">
		  		<div class="next"><a href="<?php echo $this->url(array_merge($_GET, array('page' => $this->next))); ?>" title="Next" >Next</a></div>
		  	</div>
			<div class="button2-left">
				<div class="end"><a href="<?php echo $this->url(array('page' => $this->pageCount))?>" title="End">End</a></div>
			</div>
        <?php else: ?>
          	<div class="button2-left off">
		  		<div class="next"><span>Next</span></div>
		  	</div>
			<div class="button2-left">
				<div class="end"><span>End</span></div>
			</div>
	    <?php endif; ?>
    <?php endif; ?>
</div>	